An image coding process and notion detecting process using bidirectional prediction

ABSTRACT

An image processing apparatus/method wherein a reference image in a forward direction is stored in a first memory area, a reference image in a backward direction is stored in a second memory area, and a reference image in a forward direction in an expanded range is stored in a third memory area. A first motion vector is detected by reading image data stored in the first memory area, and a second motion vector is detected by reading image data stored in the second or third memory area. Input image data is coded, through motion compensation prediction, by using the first or second motion vector.  
     An image processing apparatus (method) wherein an absolute difference value of each pixel between image data of first and second fields is calculated, the calculated absolute difference value is compared with a first threshold value, the sum total of comparison results is calculated, and in accordance with the calculated sum total, a field correlation of the image data between the first and second fields is judged.  
     An image processing apparatus (method) wherein an absolute difference value of each pixel between image data of first and second fields is calculated, the calculated absolute difference value is compared with a first threshold value, the comparison results are counted, and in accordance with the count value, a field correlation of the image data between the first and second fields is judged.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to an image processing apparatus,and more particularly to an image data coding process and a motiondetecting process.

[0003] 2. Related Background Art

[0004] Several schemes of coding (compressing) a large amount of movingimage data have been used in practice. A typical one among them is MPEG2 (Moving Picture Expert Group 2).

[0005] MPEG 2 has been realized by a combination of several datacompression techniques using DCT (Discrete Cosine Transform), such asorthogonal transform coding technique, motion compensation bidirectionalprediction coding technique, and variable length coding technique.

[0006] The principle of a coding method by MPEG 2 will be describedhereinunder.

[0007] In order to realize high efficiency coding by MPEG 2, redundancyin the time axis direction is first reduced by obtaining differencesbetween images, and then redundancy in the space axis direction isreduced by using discrete cosine transform (DCT) and variable lengthcoding.

[0008] Reduction of redundancy in the time axis direction will first bedescribed.

[0009] Generally, an image at a certain time among consecutive movingimages is very similar to images after and before the certain time.Therefore, for example, if a difference between an image now to beencoded and an image forward in the time axis direction is transmittedas shown in FIG. 1, it becomes possible to reduce redundancy in the timeaxis direction and the amount of information to be transmitted. An imageencoded in this manner is called a predictive-coded picture, P picture,to be described later.

[0010] Similarly, if a smaller one of differences between an image nowto be encoded and an image forward or backward in the time axisdirection or an image formed through interpolation of images forward andbackward in the time axis direction, is transmitted, it becomes possibleto reduce redundancy in the time axis direction and the amount ofinformation to be transmitted. An image encoded in this manner is calleda bidirectionally predictive-coded picture, B picture, to be describedlater.

[0011] In FIG. 1, images indicated by reference character I areintraframe-coded pictures, I pictures, to be described later. Imagesindicated by reference characters P and B are P and B pictures,respectively.

[0012] So-called motion compensation is performed in order to form aprediction image.

[0013] In motion compensation, for example, a block (hereinafter calleda macro block) of 16×16 pixels constituted by a unit block of 8×8 pixelsis used, and an area near a macro block of an image before motion havinga smallest difference from a prediction image is searched and adifference between image data in the searched area and the predictionimage data is transmitted to reduce the amount of data to be encoded.

[0014] In practice, in the case of P picture for example, of image dataof a difference from a prediction image after motion compensation andimage data before motion compensation itself, the image data having asmaller amount of data is selected in the unit of macro block of 16×16pixels and encoded.

[0015] However, in this case, it is necessary to send a larger amount ofdata at an area (image) appeared after the object moved. To avoid this,in the case of B picture for example, image data having the smallestamount of data is encoded by selecting from four image data sets,including a difference from an already decoded, motion compensated imageforward in the time axis direction, a difference from an alreadydecoded, motion compensated image backward in the time axis direction, adifference from an interpolated image of the two forward and backwardimages, and the image data itself now to be encoded.

[0016] Next, reduction of redundancy in the space axis direction will bedescribed.

[0017] For calculating a difference of image data, image data issubjected to discrete cosine transform (DCT) with respect to each of aunit block of 8×8 pixels. DCT transforms image data into frequencycomponents. For example, image signals of a natural scene taken with atelevision camera are smooth in many cases. If DCT is executed for suchsmooth image signals, the data amount can be reduced efficiently.

[0018] Specifically, if DCT is executed for such smooth image signals ofa natural scene, large values are concentrated on some coefficients. Asthese coefficients are quantized, the 8×8 coefficient block takes nearlya zero value and only large coefficients are left. In transmitting 8×8coefficient block data, the data is Huffman coded in the order ofso-called zigzag scan so that the data transmission amount can bereduced. Image is reconfigured at the decoder in the reverse order.

[0019] I, P, and B pictures will be described next.

[0020] In encoding I picture, only closed information in a single imageis used. Therefore, in decoding it, an image can be reconfigured byusing only the information of I picture itself. In practice, adifference is not calculated but I picture itself is subjected to DCT toencode it.

[0021] As a prediction image (image used as a reference for calculatinga difference) of P picture, already decoded I or P picture forward inthe time axis direction is used. In practice, a more efficient one ofencoding image data of a difference from a motion compensated predictionimage and encoding (intra-encoding) image data before motioncompensation is selected in the unit of macro block.

[0022] As a prediction image of B picture, three picture types are used,including already decoded I and P pictures forward in the time axisdirection and a picture formed through interpolation of I and P picturesis used. A most efficient one of encoding image data of differences ofthe above three picture types after motion compensation andintra-encoding is selected in the unit of macro block.

[0023] Since B picture uses bidirectional prediction, it is necessary touse motion vector detector circuits for forward and backwardpredictions. Since the circuits refer to different image memories, atwofold circuit scale is necessary as compared to P picture, i.e., onlyforward prediction.

[0024] Coding efficiency is generally improved by bidirectionalprediction coding which reduces prediction errors. However, codingefficiency improvement is not so much expected for rapid motion imagessuch as real time sport scenes, images having a high frequency of fastcamera spanning, and other images, and the decoded image quality isinevitably degraded.

[0025] In order to suppress this degradation, it is necessary to reduceprediction errors also for fast moving images. In improving the codingefficiency, it is therefore effective to expand a search range of motioncompensation prediction and raise a precision of calculating a motionvector.

[0026] However, if the search range is expanded, the calculation amountincreases correspondingly and the hardware amount of motion vectordetector circuits increases, so that the cost of the apparatus becomeshigh.

SUMMARY OF THE INVENTION

[0027] It is an object of the present invention under theabove-described background art to provide an image processing apparatusand method capable of suppressing degradation of the decoding quality ofspecial images and improving the image quality, without prolonging aprocess time and without a large increase of cost.

[0028] According to a preferred embodiment of the invention, in order toattain the above objective, there is provided an image processingapparatus (method) capable of coding image data through bidirectionalprediction, comprising storage means (step) for storing a referenceimage in a forward direction, in a first memory area, a reference imagein a backward direction, in a second memory area, and a reference imagein a forward direction in an expanded range, in a third memory area;first motion vector detecting means (step) for detecting a motion vectorby reading image data stored in the first memory area; second motionvector detecting means (step) for detecting a motion vector by readingimage data stored in the second or third memory area; and coding means(step) for coding, through motion compensation prediction, input imagedata by using a motion vector detected by the first or second motionvector detecting means.

[0029] It is another object of the present invention to provide an imageprocessing apparatus and method capable of quickly and precisely judgingcorrelation of image data which correlation is used as parameters forswitching between coding process modes.

[0030] According to another preferred embodiment of the invention, inorder to attain the above objective, there is provided an imageprocessing apparatus (method) comprising absolute difference valuecalculating means (step) for calculating an absolute difference value ofeach pixel between image data of first and second fields constituting aframe image; first comparison means (step) for comparing the absolutedifference value calculated by the absolute difference value calculatingmeans with a first threshold value; calculation means (step) forcalculating a sum total of comparison results of the first comparisonmeans; and judging means (step) for judging a field correlation of theimage data between the first and second fields in accordance with thesum total calculated by the calculation means.

[0031] According to still another preferred embodiment of the invention,there is also provided an image processing apparatus (method) comprisingabsolute difference value calculating means (step) for calculating anabsolute difference value of each pixel between image data of first andsecond fields constituting a frame image; first comparison means (step)for comparing the absolute difference value calculated by the absolutedifference value calculating means with a first threshold value; countmeans (step) for counting comparison results of the first comparisonmeans; and judging means (step) for judging a field correlation of theimage data between the first and second fields in accordance with acount value of the count means.

[0032] Other objects, features and advantages of the invention willbecome apparent from the following detailed description taken inconjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0033]FIG. 1 is a diagram illustrating prediction pictures of MPEG 2.

[0034]FIG. 2 is a block diagram showing an example of the structure ofan image processing apparatus according to an embodiment of theinvention.

[0035]FIG. 3 is a diagram showing the ranges of image data stored ineach image memory shown in FIG. 2.

[0036]FIGS. 4A and 4B are diagrams illustrating frame DCT and field DCT.

[0037]FIG. 5 is a block diagram showing an example of the structure ofan image processing apparatus according to another embodiment of theinvention.

[0038]FIG. 6 is a diagram showing a first example of the structure of afield correlation detector circuit 30 shown in FIG. 5.

[0039]FIG. 7 is a diagram showing a relationship between fields.

[0040]FIG. 8 is a diagram showing a second example of the structure ofthe field correlation detector circuit 30 shown in FIG. 5.

[0041]FIG. 9 is a diagram showing a third example of the structure ofthe field correlation detector circuit 30 shown in FIG. 5.

[0042]FIG. 10 is a diagram illustrating the operation of the circuitshown in FIG. 9.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0043] Embodiments of the invention will be described in the following.

[0044]FIG. 2 is a block diagram showing a structure of an imageprocessing apparatus of an embodiment of the present invention.

[0045] Referring to FIG. 2, digital image data is input from an inputterminal 1.

[0046] An image rearranging circuit 2 rearranges each picture such asintraframe-coded I picture, predictive-coded P picture, andbidirectionally predictive-coded B picture, so that a predictionreference picture is encoded in advance.

[0047] In an intraframe-coding mode, data of a macro block (16×16pixels) of the image data is sent via a first mode select switch 10 to aDCT circuit 4 to DCT transform it in the unit of a DCT block (8×8pixels).

[0048] In a motion compensation prediction encoding mode, in accordancewith input image data to be encoded and a reference image data stored ina image memory 16, 17, 18, a motion detection circuit 19, 20 detects amotion vector. In accordance with this motion vector, a motioncompensation prediction circuit 14 generates a prediction picture forthe image data to be encoded. A subtractor 3 calculates a differencebetween the generated prediction image data and the image data to beencoded to obtain a prediction error signal which is then DCTtransformed by the DCT circuit 4.

[0049] The details of the motion compensation prediction encoding willbe later described.

[0050] Image data transformed by the DCT circuit 4 is quantized by aquantization circuit 5. A quantization step of the quantization circuit5 is controlled by a rate control circuit 9 which monitors the amount ofdata stored in a buffer memory 7.

[0051] The image data quantized by the quantization circuit 5 as well asthe motion vector and encoding mode information supplied from a modeselection circuit 21 is input to a variable length coding circuit 6. Thevariable length coding circuit 6 executes a data compression process byallocating codes of high transmission efficiency in accordance withstatistical nature of input data.

[0052] The variable length coded data is temporarily stored in thebuffer memory 7 and then output from an output terminal 8 in the MPEGformat.

[0053] Since I and P pictures are used for reference pictures of motioncompensation prediction, the quantized image data is converted into theoriginal image data which is input to the DCT circuit 4, by an inversequantization circuit 11 and an inverse DCT circuit 12.

[0054] In the case of P picture, prediction image data supplied via asecond mode selection switch 15 from the motion compensation predictioncircuit 14 is added by an adder 13 for local decoding and stored in oneof the image memories 16, 17, and 18.

[0055] In encoding each picture, the mode selection circuit 21determines each coding mode in the macro block unit in accordance withthe amount of generated information.

[0056] The coding mode varies from one picture to another. In thisembodiment, mean square errors in the macro block are compared and amode which provides a minimum means square error is selected. However,any other mode selection process is applicable to the present invention.

[0057] A method of generating a motion compensation prediction pictureand its circuit structure will be described.

[0058] The positions of pixels of the reference image data relative tothe image data to be encoded, determine one of the memories 16, 17, and18 in which the reference image data is stored.

[0059]FIG. 3 illustrates a range of image data to be stored in the imagememory.

[0060] First, B picture for bidirectional prediction will be described.

[0061] The reference picture for forward prediction is stored in thefirst image memory 16 by reproducing past image data of I or P picturein a range (indicated by reference number 42 in FIG. 3: 32×32 pixels)broader than the macro block positioned at the center of this range(indicated at 41 in FIG. 3: 16×16 pixels) of the image data to beencoded.

[0062] The first motion vector detection circuit 19 compares thereference image data stored in the first image memory 16 with the imagedata in the macro block to be encoded, through block matching, tothereby detect a motion vector MV1. This motion vector MV1 is sent tothe motion compensation prediction circuit 14 and mode selection circuit21.

[0063] A future reference picture for backward prediction is stored inthe second image memory 17, with the same size as the forwardprediction. Similar to the forward prediction, the second motion vectordetection circuit 24 detects a motion vector MV2 which is sent to themotion compensation prediction circuit 14 and mode selection circuit 21.

[0064] The motion compensation prediction circuit 14 generates a motioncompensated and predicted image, in accordance with a past reproducedimage and motion vector MV1 and a future reproduced image and motionvector MV2.

[0065] Which data among forward/backward/bidirectional predictions isused for generating a prediction picture is determined by the modeselection circuit 21 which selects a mode having a minimum mean squareerror among all prediction modes. This mode information is supplied tothe motion compensation prediction circuit 14.

[0066] For the determination of either an intraframe coding or a motioncompensation prediction coding, the first and second motion vectordetection circuits 19 and 20 calculate a mean square deviation of theimage data in the macro block to be encoded and a mean square error tobe used for prediction and send them to the mode selection circuit 21.

[0067] In accordance with the supplied information, the mode selectioncircuit 21 selects an optimum encoding mode by switching between thefirst and second mode selection switches 10 and 15. The two modeselection switches 10 and 15 operate synchronously. Characters “In” inFIG. 2 indicate an intraframe coding mode, and characters “MC” indicatea motion compensation prediction coding mode.

[0068] Next, P picture for forward prediction will be described.

[0069] Similar to B picture for forward prediction, a past reproducedimage data is stored in the first image memory 16 and the first motionvector detection circuit 19 compares the reference image data stored inthe first image memory 16 with the image data in the macro block to beencoded, to thereby detect the motion vector MV1. The third image memory18 stores image data of the same timing as the reference image datastored in the first image memory 16, the image data being in a rangebroader than the reference image data (as shown in FIG. 3: 48×32 pixelsexcepting the central area).

[0070] As shown in FIG. 3, the image data stored in the third imagememory 18 and the image data stored in the first image memory 16 areoverlapped slightly.

[0071] The second motion vector detection circuit 20 compares thereference image data stored in the third image memory 18 with the imagedata in the macro block to be encoded, to thereby detect the motionvector MV2. The motion vectors MV1 and MV2 are supplied to the motioncompensation prediction circuit 14.

[0072] In order to obtain an optimum motion vector and an optimumreference picture, which data is used for generating a motioncompensated and predicted picture is determined by the first and secondmotion vector detection circuits 19 and 20 which calculate squareprediction errors and supply them to the mode selection circuit 21. Themode selection circuit 21 selects data from the detection circuit whichprovides a smallest square prediction error, and its information issupplied to the motion compensation prediction circuit 14.

[0073] In the above embodiment, for the forward prediction, a motionvector detection circuit (motion vector detection circuit 20 in FIG. 2)for backward prediction not conventionally used is utilized for a motionvector detection circuit for forward prediction with respect to abroadened search range. It is therefore possible to raise a precision ofcalculating a motion vector.

[0074] Degradation of a quality of a fast moving special image decodedcan be suppressed without a large cost increase. This is very effective,particularly for a program contents transmission encoding apparatuswhich requires a high image quality.

[0075] In MPEG, an image is processed in the unit of picture. In MPEG 2,the picture may be assigned a frame or a field.

[0076] If a frame is assigned to the picture, this assignment is calleda frame structure, whereas if a field is assigned to the picture, thisassignment is called a field structure.

[0077] For coding purpose, the frame and field structures may be mixedin one sequence of images or one of them only may be used.

[0078] There is field/frame prediction for coding an interlace image byMPEG 2 in which in order to deal with a motion between fields, motionvectors are obtained both between fields and between frames to performmotion compensation prediction using optimum vectors.

[0079] DCT may be switched between a frame DCT mode and a field DCT modein the unit of macro block (refer to FIGS. 4A and 4B). This DCTswitching is performed independently from prediction modes.

[0080] For example, in incorporating the DCT frame and field modes intothe embodiment of FIG. 2, correlation between fields of image dataoutput from the image rearranging circuit shown in FIG. 2 is detectedand the DCT circuit 4 and inverse DCT circuit 12 are controlled so thattransform operation is executed in the frame mode if correlation ishigh.

[0081] Structure of this embodiment is shown in FIG. 5. In FIG. 5, likeelements to those shown in FIG. 2 are represented by using identicalreference numbers, and the description thereof is omitted.

[0082] A field correlation detection circuit 30 detects correlationbetween fields of image data output from the image rearranging circuit2, the detected correlation being supplied to a DCT circuit 4′, aninverse DCT circuit 12′, and a variable length coding circuit 6′.

[0083] In response to an output signal from the field correlationdetection circuit 30, the DCT circuit 4′ and inverse DCT circuit 12′operate to switch between the frame DCT mode and the field DCT mode.

[0084] The detected correlation is also supplied to a multiplexingcircuit 31 to multiplex it with the coded image data, the multiplexedimage data being output from the output terminal 8.

[0085] An example of the structure of the field correlation detectioncircuit 30 will be described.

[0086]FIG. 6 is a block diagram showing an example of the structure ofthe field correlation detection circuit 30 shown in FIG. 5.

[0087] In FIG. 6, reference numeral 61 represents an image data inputterminal, reference numeral 62 represents a field memory for storingfirst field image data input from the image data input terminal 61during one frame period, and reference numeral 63 represents acalculator for calculating an absolute difference of pixels betweensecond field image data input from the image data input terminal 61 andthe first field image data delayed by one field period and output fromthe field memory 62.

[0088] Reference numeral 64 represents a first comparator for performinga first judgement by comparing an absolute difference output from theabsolute difference calculator 63 with a predetermined first thresholdvalue Th1, reference numeral 65 represents a sum total calculator forcalculating a sum of the outputs from the comparator 64 during one fieldperiod, reference numeral 66 represents a second comparator forcomparing the sum calculated by the sum total calculator 64 with apredetermined second threshold value Th2 and judging whether the wholeof the frame is processed in the field unit or whether part or the wholeof the frame is processed in the frame unit, and reference numeral 67represents an output terminal from which the judgement by the comparator6 is output.

[0089] The operation of the field correlation detection circuit 30 willbe described next.

[0090] Of the frame image data constituted by the first and secondfields input from the image data input terminal 61, the first fieldimage data is input to the field memory 62. Following the first fieldimage data, the second field image data is input to the field memory 62and to the absolute difference calculator 63. Synchronously with thisinput, the first field image data is read from the field memory 62 andsupplied to the absolute difference calculator 63. In this case, asshown in FIG. 7, since the pixel positions of the first and second fieldimage data are displaced by a half pixel in the vertical direction, thefirst field image data is displaced downward by a half pixel tocalculate absolute differences.

[0091] Next, the first comparator 64 compares each absolute differencesupplied from the absolute difference calculator 63 with thepredetermined first threshold value Th1 (0<Th1<(number of half-tonelevels of pixels)) to thereby execute the first judgement. Thereafter,the sum total calculator 65 calculates a sum of motion judgement resultsof all pixels of the first and second fields. Next, the secondcomparator 66 compares the sum with the predetermined second thresholdTh2 (0<Th2<(number of all pixels in the fields)×(number of first judgeresult levels)).

[0092] If the sum is smaller than Th2, it is judged that the frame imagehas a small motion, and the DCT block is configured by a block of onlythe first or second field image data, or by a block of both the firstand second field image data. On the other hand, if the sum is largerthan Th2, it is judged that the frame image has a large motion, and theDCT block is configured exclusively by a block of only the first orsecond field image data. After such a comparison result is output fromthe output terminal 7, the similar process is executed for the nextframe.

[0093] Consider now high-vision data having a frame constituted ofeffective pixels of 1920×1080. With the above structure and operation,the number of judgement level steps becomes 1920×540≈1 M steps (assumingan output of the first comparator 64 is one bit). Therefore, the circuitscale of the sum total calculator 65 made of adders, shift registers andthe like can be reduced and the operation can be speeded up.

[0094] As stated earlier, the pixel positions of the first and secondfields are displaced by a half pixel as shown in FIG. 7. In analternative method, an average value of upper and lower pixels of, forexample, the first field, is calculated to perform an interpolationprocess to virtually align the pixel positions of the first field withthose of the second field. After this interpolation process, the imagedata is input to the absolute difference calculator 63.

[0095] Furthermore, a plurality of threshold values Th1 may be set tothe first comparator 64. In this case, the threshold values Th1 is setsmaller than absolute differences.

[0096]FIG. 8 shows another embodiment of the field correlation detectioncircuit 30.

[0097] In this embodiment, without using the sum total calculator 65 oradder of FIG. 6, a counter 68 is used to make the circuit scale smallerthan the first embodiment.

[0098] In FIG. 8, like elements to those shown in FIG. 6 are representedby using identical reference numerals, and the description thereof isomitted.

[0099] An absolute difference calculated by the absolute differencecalculator 63 is converted into a binary value by the first comparator64. Specifically, if the absolute value is larger than the thresholdvalue Th1, a true value is supplied to the counter 68, whereas if it issmaller, a false value is supplied. If the output from the comparator 64is a true value, the counter 68 counts up, whereas if a false value, itholds the current state. These operations are repeated until thecomparator 64 completes the judgement of all pixels of the first andsecond fields. The comparison result is supplied to the secondcomparator 66 which performs similar operations to the first example andoutputs the judgement result from the output terminal 67.

[0100]FIG. 9 shows still another embodiment of the field correlationdetection circuit 30.

[0101] In this embodiment, image data input from the input terminal 61is supplied to a data selector 69 which samples only a portion of theimage data and supplies it to the field memory 62 and absolutedifference calculator 63.

[0102] More specifically, the data selector 69 passes and outputs aportion of the input image data, for example, image data only at thepixel positions indicated by solid black circles and solid blacktriangles shown in FIG. 10. Selection of pixel data may be set asdesired so long as a difference of pixels between the first and secondfields can be calculated.

[0103] Next, the absolute difference calculator 63 calculates absolutedifferences of the selected pixel data to perform the first judgement.The sum total calculator 65 calculates a sum of first judgement resultsduring one frame period and supplies it to the second comparator 66.

[0104] With the above structure and operation, the number of judgementsteps can be reduced further and the hardware scale can be reduced. Thisembodiment of the field correlation calculation circuit may be appliedto the circuit shown in FIG. 8.

[0105] According to the field correlation calculation circuits describedabove, the circuit scale of the sum total calculator made of adders,shift registers and the like can be reduced and the operation can bespeeded up.

[0106] In the embodiments shown in FIGS. 2 and 5, three image memoriesare discretely provided. The invention is not limited thereto, but threebanks may be provided in one image memory.

[0107] In other words, the foregoing description of embodiments has beengiven for illustrative purposes only and is not to be construed asimposing any limitation in every respect.

[0108] The scope of the invention is, therefore, to be determined solelyby the following claims and not limited by the text of the specificationand alterations made within a scope equivalent to the scope of theclaims fall within the true spirit and scope of the invention.

What is claimed is:
 1. An image processing apparatus capable of codingimage data through bidirectional prediction, comprising: a) a firstmemory for storing a reference image in a forward direction; b) firstmotion vector detecting means for detecting a motion vector by readingimage data stored in said first memory; c) a second memory for storing areference image in a backward direction; d) a third memory for storing areference image in a forward direction in an expanded range; e) secondmotion vector detecting means for detecting a motion vector by readingimage data stored in said second or third memory; and f) coding meansfor coding, through motion compensation prediction, input image data byusing a motion vector detected by said first or second motion vectordetecting means.
 2. An apparatus according to claim 1 , wherein saidsecond motion vector detecting means detects a motion vector forbidirectional prediction by reading image data stored in said secondmemory, and detects a motion vector for forward prediction by readingimage data stored in said third memory.
 3. An apparatus according toclaim 1 , further comprising means for selecting either a motion vectorselected by said first motion vector detecting means or a motion vectorselected by said second motion vector.
 4. An apparatus according toclaim 3 , wherein said selecting means selects a motion vector inaccordance with prediction error signals obtained on the basis of amotion vector selected by said first motion vector detecting means and amotion vector selected by said second motion vector.
 5. An apparatusaccording to claim 1 , wherein said coding means includes transformingmeans for orthogonally transforming image data.
 6. An apparatusaccording to claim 5 , wherein said image data is interlace image data,and said transforming means is provided with a field transform mode fortransforming in the unit of field and a frame transform mode fortransforming in the unit of frame.
 7. An apparatus according to claim 6, wherein said transforming means includes detection means for detectinga field correlation of said image data, and said transform mode isselected in accordance with a field correlation detected by saiddetection means.
 8. An apparatus according to claim 7 , wherein saiddetection means comprises: absolute difference value calculating meansfor calculating an absolute difference value of each pixel between imagedata of first and second fields constituting a frame image; firstcomparison means for comparing the absolute difference value calculatedby said absolute difference value calculating means with a firstthreshold value; calculation means for calculating a sum total ofcomparison results of said first comparison means; and judging means forjudging a field correlation of said image data between the first andsecond fields in accordance with the sum total calculated by saidcalculation means.
 9. An apparatus according to claim 7 , wherein saiddetection means comprises: absolute difference value calculating meansfor calculating an absolute difference value of each pixel between imagedata of first and second fields constituting a frame image; firstcomparison means for comparing the absolute difference value calculatedby said absolute difference value calculating means with a firstthreshold value; count means for counting comparison results of saidfirst comparison means; and judging means for judging a fieldcorrelation of said image data between the first and second fields inaccordance with a count value of said count means.
 10. An imageprocessing apparatus comprising: a) absolute difference valuecalculating means for calculating an absolute difference value of eachpixel between image data of first and second fields constituting a frameimage; b) first comparison means for comparing the absolute differencevalue calculated by said absolute difference value calculating meanswith a first threshold value; c) calculation means for calculating a sumtotal of comparison results of said first comparison means; and d)judging means for judging a field correlation of said image data betweenthe first and second fields in accordance with the sum total calculatedby said calculation means.
 11. An apparatus according to claim 10 ,further comprising data extracting means for extracting a portion ofsaid image data of the first and second fields and supplying the imagedata portion to said absolute difference value calculating means.
 12. Animage processing apparatus comprising: a) absolute difference valuecalculating means for calculating an absolute difference value of eachpixel between image data of first and second fields constituting a frameimage; b) first comparison means for comparing the absolute differencevalue calculated by said absolute difference value calculating meanswith a first threshold value; c) count means for counting comparisonresults of said first comparison means; and d) judging means for judginga field correlation of said image data between the first and secondfields in accordance with a count value of said count means.
 13. Anapparatus according to claim 12 , further comprising data extractingmeans for extracting a portion of said image data of the first andsecond fields and supplying the image data portion to said absolutedifference value calculating means.
 14. An image processing methodcapable of coding image data through bidirectional prediction,comprising: a) a first storage step of storing a reference image in aforward direction in a first memory area; b) a first motion vectordetecting step of detecting a motion vector by reading image data storedin said first memory area; c) a second storage step of storing areference image in a backward direction in a second memory area; d) athird storage step of storing a reference image in a forward directionin an expanded range, in a third memory area; e) a second motion vectordetecting step of detecting a motion vector by reading image data storedin said second or third memory area; and f) a coding step of coding,through motion compensation prediction, input image data by using amotion vector detected by said first or second motion vector detectingstep.
 15. An image processing method comprising: a) an absolutedifference value calculating step of calculating an absolute differencevalue of each pixel between image data of first and second fieldsconstituting a frame image; b) a first comparison step of comparing theabsolute difference value calculated by at absolute difference valuecalculating step with a first threshold value; c) a calculation step ofcalculating a sum total of comparison results obtained at said firstcomparison step; and d) a judging step of judging a field correlation ofsaid image data between the first and second fields in accordance withthe sum total calculated at said calculation step.
 16. An imageprocessing method comprising: a) an absolute difference valuecalculating step of calculating an absolute difference value of eachpixel between image data of first and second fields constituting a frameimage; b) a first comparison step of comparing the absolute differencevalue calculated at said absolute difference value calculating step witha first threshold value; c) a count step of counting comparison resultsobtained at said first comparison step; and d) a judging step of judginga field correlation of said image data between the first and secondfields in accordance with a count value obtained at said count step. 17.An image processing apparatus capable of coding image data throughbidirectional prediction, comprising: a) storage means for storing areference image in a forward direction, in a first memory area, areference image in a backward direction, in a second memory area, and areference image in a forward direction in an expanded range, in a thirdmemory area; b) first motion vector detecting means for detecting amotion vector by reading image data stored in said first memory area; c)second motion vector detecting means for detecting a motion vector byreading image data stored in said second or third memory area; and d)coding means for coding, through motion compensation prediction, inputimage data by using a motion vector detected by said first or secondmotion vector detecting means.
 18. An apparatus according to claim 17 ,wherein said second motion vector detecting means detects a motionvector for bidirectional prediction by reading image data stored in saidsecond memory area, and detects a motion vector for forward predictionby reading image data stored in said third memory area.
 19. An apparatusaccording to claim 17 , further comprising means for selecting either amotion vector selected by said first motion vector detecting means or amotion vector selected by said second motion vector.
 20. An apparatusaccording to claim 19 , wherein said selecting means selects a motionvector in accordance with prediction error signals obtained on the basisof a motion vector selected by said first motion vector detecting meansand a motion vector selected by said second motion vector.
 21. An imageprocessing method capable of coding image data through bidirectionalprediction, comprising: a) a storage step of storing a reference imagein a forward direction, in a first memory area, a reference image in abackward direction, in a second memory area, and a reference image in aforward direction in an expanded range, in a third memory area; b) afirst motion vector detecting step of detecting a motion vector byreading image data stored in said first memory area; c) a second motionvector detecting step of detecting a motion vector by reading image datastored in said second or third memory area; and d) a coding step ofcoding, through motion compensation prediction, input image data byusing a motion vector detected at said first or second motion vectordetecting step.